<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class OrderProduct extends Model
{
    protected $guarded = ['id'];
  

    // public function product()
    // {
    // 	//return $this->belongsTo(Product::class);
    // }

    public function getProductPriceTxtAttribute()
    {
    	return $this->product_price/100;
    }

    public function getTotalPriceTxtAttribute() 
    {
    	return $this->total_price/100;
    }

    public function getSubtotalTxtAttribute() 
    {
        return $this->subtotal/100;
    }

    

    public function getWeightAttribute()
    {
        return object_get($this->product,'weight');
    }
}
